import { Account } from "@ugeez/frontend-commons/lib/types";

export * from './biz';

//////////////////////////////////
//  UI
//////////////////////////////////

export interface IStore {
    readonly user: User;
    readonly locale: string;
    updateUser(user: User): void;
    keepAlive(): Promise<void>;
    switchLocale(locale: string): void;
    dispose(): void;
};

export interface IAdminStore extends IStore {
    login(auth: string | User): void;
    logout(): void;
};

//////////////////////////////////
//  data
//////////////////////////////////

export enum UserRole {
    ADMIN = 'admin',
    AUDIT = 'audit',
    ACCOUNTING = 'accounting',
};

export type User = {
    roles: UserRole[] | undefined;
} & Account;